﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using negocios;
using objetos;
using System.Web.Script.Serialization;

namespace softsales.pagina.imposto_csosn
{
    /// <summary>
    /// Summary description for imposto_csosn
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [System.Web.Script.Services.ScriptService]
    public class imposto_csosn : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod]
        public string SelecionarPorId(string id)
        {
            try
            {
                OBJ_TB_IMPOSTO_CSOSN o_tb_imposto_csosn = new OBJ_TB_IMPOSTO_CSOSN();
                BLL_TB_IMPOSTO_CSOSN b_tb_imposto_csosn = new BLL_TB_IMPOSTO_CSOSN();

                o_tb_imposto_csosn = b_tb_imposto_csosn.SelecionarObjetoPorId(Convert.ToInt32(id));

                if (o_tb_imposto_csosn != null)
                {
                    JavaScriptSerializer js = new JavaScriptSerializer();
                    return js.Serialize(o_tb_imposto_csosn);
                }
                else
                {

                    return "null";
                }

            }
            catch (Exception ex)
            {

                return ex.Message;
            }

        }
    }

   
}
